IF exists(SELECT * FROM dbo.sysobjects WHERE name='frXML_parameters' AND xtype='FN') 
BEGIN
	DROP FUNCTION frXML_parameters
END
GO

CREATE   function frXML_parameters(@naam varchar(50),@deAard char(1),@dePeriode char(2))
returns varchar(50)
begin
  declare @waarde varchar(50)
  select @waarde=waarde from fr_parameters
  where naam = @naam
	and aard = @deAard
	and periode = @dePeriode
  return @waarde
end